package com.learn.injection;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author Created by chenxin34 on 2021/7/8 下午9:56.
 */
@Service
public class AA implements InitializingBean {
    public AA() {
        System.out.println(new Date() + "constructor AA");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Autowired
    private BB bb;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("A afterPropertiesSet");
    }
}
